/**WPI CS509 Stratego logout message
 * 
 */
package edu.wpi.cs509.messages.server;

import edu.wpi.cs509.messages.MsgBc;
import edu.wpi.cs509.representation.UserName;


/**
 * This mesage implements logout.
 * @author sparadis
 *
 */
public class MsgLogout extends MsgSvUserContext {
	
	/**
	 * serializable version number
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * Constructor.
	 */
	public MsgLogout() {
		super(new UserName(""));
	}
	
	/**
	 * Constructor.
	 * @param username - the username to log out.
	 */
	public MsgLogout(UserName username) {
		super(username);
	}
	
	/**
	 * Perform a logout.
	 * @return MsgBc - the result of the logout.
	 */
	@Override
	public MsgBc doExecuteAndGetReply() {
		getServer().logout(getConnection());
		return null;
	}
}
